<html>
<head><meta charset="utf-8"><title>cache_on_disk · t-compiler/const-eval · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/index.html">t-compiler/const-eval</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/cache_on_disk.html">cache_on_disk</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="146854795"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/cache_on_disk/near/146854795" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/cache_on_disk.html#146854795">(Nov 06 2018 at 09:36)</a>:</h4>
<p><span class="user-mention" data-user-id="124288">@Oli</span> I see a new <code>cache_on_disk</code> method for each query... do you think we should use that to not cache <code>const_eval_raw</code>, or some such thing?</p>



<a name="146854811"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/cache_on_disk/near/146854811" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/cache_on_disk.html#146854811">(Nov 06 2018 at 09:37)</a>:</h4>
<p>seems like not caching is even the default oO</p>



<a name="146854817"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/cache_on_disk/near/146854817" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/cache_on_disk.html#146854817">(Nov 06 2018 at 09:37)</a>:</h4>
<p>;)</p>



<a name="146854818"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/cache_on_disk/near/146854818" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/cache_on_disk.html#146854818">(Nov 06 2018 at 09:37)</a>:</h4>
<p>but the const queries both get cached</p>



<a name="146854822"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/cache_on_disk/near/146854822" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/cache_on_disk.html#146854822">(Nov 06 2018 at 09:37)</a>:</h4>
<p>huh</p>



<a name="146854828"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/cache_on_disk/near/146854828" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/cache_on_disk.html#146854828">(Nov 06 2018 at 09:37)</a>:</h4>
<p>how can you tell?</p>



<a name="146854873"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/cache_on_disk/near/146854873" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/cache_on_disk.html#146854873">(Nov 06 2018 at 09:38)</a>:</h4>
<p>because they both have an explicit implementation of that method to return <code>true</code>^^</p>



<a name="146854886"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/cache_on_disk/near/146854886" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/cache_on_disk.html#146854886">(Nov 06 2018 at 09:38)</a>:</h4>
<p>looking at librustc/ty/query/config.rs</p>



<a name="146854892"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/cache_on_disk/near/146854892" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/cache_on_disk.html#146854892">(Nov 06 2018 at 09:38)</a>:</h4>
<p>(what I really set out to do was change const_eval_raw to return an allocation, not a <code>ConstValue</code>)</p>



<a name="146854915"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/cache_on_disk/near/146854915" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/cache_on_disk.html#146854915">(Nov 06 2018 at 09:39)</a>:</h4>
<p><span class="emoji emoji-2764" title="heart">:heart:</span></p>



<a name="146854962"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/cache_on_disk/near/146854962" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/cache_on_disk.html#146854962">(Nov 06 2018 at 09:40)</a>:</h4>
<p>maybe do these things in separate PRs though</p>



<a name="146854981"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/cache_on_disk/near/146854981" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/cache_on_disk.html#146854981">(Nov 06 2018 at 09:41)</a>:</h4>
<p>If statics referring to other statics are very common, then not caching <code>const_eval_raw</code> could be bad</p>



<a name="146854983"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/cache_on_disk/near/146854983" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/cache_on_disk.html#146854983">(Nov 06 2018 at 09:41)</a>:</h4>
<p>especially for large statics</p>



<a name="146855037"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/cache_on_disk/near/146855037" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/cache_on_disk.html#146855037">(Nov 06 2018 at 09:42)</a>:</h4>
<p>What are you trying to achieve by not caching <code>const_eval_raw</code>?</p>



<a name="146855043"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/cache_on_disk/near/146855043" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/cache_on_disk.html#146855043">(Nov 06 2018 at 09:43)</a>:</h4>
<p>(note that <code>&amp;'tcx Allocation</code> is already deduplicated, so the memory footprint should be minimal)</p>



<a name="146855122"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/cache_on_disk/near/146855122" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/cache_on_disk.html#146855122">(Nov 06 2018 at 09:45)</a>:</h4>
<p>yeah not going to touch the caching here</p>



<a name="146855126"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/cache_on_disk/near/146855126" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/cache_on_disk.html#146855126">(Nov 06 2018 at 09:45)</a>:</h4>
<blockquote>
<p>What are you trying to achieve by not caching <code>const_eval_raw</code>?</p>
</blockquote>
<p>dunno, save space?^^</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>